from time import sleep

from selenium.webdriver.common.by import By

import data
from key_word.KeyWord import WebKeys
from locater.allPages import *


# 以页面或页面组件为单位，封装常用的行为代码和元素定位代码
class LoginPage(WebKeys): # 继承WebKeys类
    def login(self,url,username,passwd):
        self.open(url)
        self.locator_with_wait(*page_login_user).send_keys(username)
        sleep(2)
        self.locator_with_wait(*page_login_pwd).send_keys(passwd)
        sleep(2)
        self.locator_with_wait(*page_login_button).click()

